package cn.jsj.finance.bank;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 修改律师提成发票信息处理类
 * @author LI
 *
 */
 public class ModifyRoyaltyInvoiceInfo extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
	 public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// 调试信息
		 cn.jsj.utils.SysLogger.PrintInfo("修改发票信息！！");

		 //新建律师提成发票信息对象
		 cn.jsj.pojo.TblInvoiceManage tim=new cn.jsj.pojo.TblInvoiceManage();
		 //赋值
		tim.setInvoiceNumber(request.getParameter("minvoiceid").trim());
		tim.setInvoiceTime(cn.jsj.utils.TimeDispose.transferDate(request.getParameter("minvoicetime").trim()));
		tim.setContractNumber(request.getParameter("mroyaltycontract").trim());
		tim.setInvoicePerson(request.getParameter("minvoiceperson").trim());
		tim.setInvoiceMoney(Integer.parseInt(request.getParameter("minvoiceamount").trim()));
		tim.setInvoiceRemark(request.getParameter("minvoiceremark").trim());

		//赋值完成
		cn.jsj.utils.SysLogger.PrintInfo("赋值完成----------->"+tim.getInvoicePerson());

		//更新信息
		cn.jsj.dao.TblInvoiceManageDAO timd=new cn.jsj.dao.TblInvoiceManageDAO();
		int updateResult=timd.updateInvoiceInfo(tim);

		//调试信息
		cn.jsj.utils.SysLogger.PrintInfo("更新结果----------->"+updateResult);

		//输出流
		java.io.PrintWriter out=response.getWriter();

		//如果更新成功
		if(updateResult==1){
			out.println("{message:'更新成功！'}");

		}else{
			out.println("{message:'更新失败！'}");
		}

		out.flush();
		out.close();
	}
}